const os = require("os");

console.log("CPU Arch: %s", process.arch);
console.log("OS Platform: %s", process.platform);
console.log("OS Type: %s", os.type());
console.log("OS Release: %s", os.release());

console.log("Process ID: %d", process.pid);
console.log("Node Exec Path: %s", process.execPath);

const mem = process.memoryUsage();
console.log("Memory Usage (raw): %j", mem);
console.log(
    "Memory Usage (MB) -> rss: %d, heapTotal: %d, heapUsed: %d, external: %d, arrayBuffers: %d",
    Math.round(mem.rss / 1024 / 1024),
    Math.round(mem.heapTotal / 1024 / 1024),
    Math.round(mem.heapUsed / 1024 / 1024),
    Math.round(mem.external / 1024 / 1024),
    Math.round((mem.arrayBuffers || 0) / 1024 / 1024)
);